<?php

class TestimonialsController extends Zend_Controller_Action {

    public function init() {
	/* Initialize action controller here */
    }

    public function indexAction() {
	
	/*Pagination */
        $itemsPerPageReviews = 6;
        $currentPageReviews = 1;
	if ($this->_getParam('page') && $this->_getParam('page') != "") {
            $currentPageReviews = $this->_getParam('page');
        }
	$offset = ($currentPageReviews - 1) * $itemsPerPageReviews;

	/*Load Testimonal Model*/
	$testimonailModel = new Model_Testimonial();
	$testimonails = $testimonailModel->fetchTestimonial("",$itemsPerPageReviews, $offset);
	
	$paginator = new CMS_Paginator();
	$paginator->setItemsPerPage($itemsPerPageReviews);
	$paginator->setItemsTotal($testimonailModel->getTestimonailCount());
	$paginator->setCurrentPage($currentPageReviews);
	$link = $this->view->url(array('controller' => 'testimonials', 'action' => 'index', 'page' => 'PAGENO'), 'default', true);
        $paginator->paginate($link);

	/*Passing data to View*/
        $this->view->paginator = $paginator;
	$this->view->testimonails = $testimonails;
	$this->view->helper = new CMS_Helper();;
	$this->view->showMetaDescription = TRUE;
	$this->view->showMetaKeyword = TRUE;
	$this->view->headTitle('Testimonials - Read our Testimonials, Stay Informed  - Citrusbug');
	$this->view->META_DESCRIPTION = "Here you can see our values clients testimonials or positive feedback about our web application, web design and mobile application development work.";
	$this->view->META_KEYWORDS = "web development, web design, mobile application development, seo, graphic design, offshore software development, PHP , linux programming, application development, usa, uk, canada, germany ,netherland , denmark";
	
	
    }

}

?>
